package com.yunxi.module.system.mapper.oauth2;

import com.yunxi.framework.mybatis.core.mapper.BaseMapperX;
import com.yunxi.module.system.model.oauth2.OAuth2ClientDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * OAuth2 客户端 Mapper
 * </p>
 *
 * @author lidy
 * @since 2024-05-08
 */
@Mapper
public interface OAuth2ClientMapper extends BaseMapperX<OAuth2ClientDO> {

    /**
     * 从缓存中获得 OAuth2 客户端
     *
     * @param clientId 客户端编号
     * @return OAuth2 客户端
     */
    default OAuth2ClientDO selectByClientId(String clientId) {
        return selectOne(OAuth2ClientDO::getClientId, clientId);
    }
}
